﻿using Compass.Wasm.Shared.Purchases;
using Compass.Wasm.Shared.Wms;
using Zack.DomainCommons.Models;

namespace Compass.PurchaseService.Domain.Entities;

public record NavInvReportGroup : AggregateRootEntity
{
    public DateTime YearMonth { get; private set; }
    public Group_e Group { get; private set; }
    public double InvValue { get; private set; }

    private NavInvReportGroup() { }
    public NavInvReportGroup(Guid id, DateTime yearMonth, Group_e group, double invValue)
    {
        Id=id;
        YearMonth=yearMonth;
        Group=group;
        InvValue=invValue;
    }

    #region Update
    public void Update(NavInvReportGroupDto dto)
    {
        ChangeYearMonth(dto.YearMonth)
            .ChangeGroup(dto.Group)
            .ChangeInvValue(dto.InvValue);

        NotifyModified();
    }

    public NavInvReportGroup ChangeYearMonth(DateTime yearMonth)
    {
        YearMonth=yearMonth;
        return this;
    }
    public NavInvReportGroup ChangeGroup(Group_e group)
    {
        Group=group;
        return this;
    }
    public NavInvReportGroup ChangeInvValue(double invValue)
    {
        InvValue=invValue;
        return this;
    }
    #endregion

}



